Repository navigation
fix: retry transient HTTP errors (529/502/503/504) without --wait - #377
Merged
Merged
Conversation
529 Overloaded and the 502/503/504 gateway errors were in claude_limit_patterns, which only retries when --wait is set, and then waits the full quota duration. without --wait a transient 529 hard-failed the run (seen during claude review 2). these are short-lived server hiccups, not account-quota limits, so they move to claude_retry_patterns: checked first, auto-retried via the existing timeout path, no --wait needed, bounded by iteration limits. 500 stays out since it can be a deterministic failure, still caught by the broad `API Error:` error pattern. also add a fixed 5s backoff before re-running a timed-out or transiently-failed iteration in the task and review loops, so retries don't hammer immediately.
Deploying ralphex with
|
| Latest commit: |
1cb32ed
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1ac107dd.ralphex.pages.dev |
| Branch Preview URL: | https://fix-transient-http-retry.ralphex.pages.dev |
There was a problem hiding this comment.
Pull request overview
This PR adjusts ralphex’s Claude pattern handling and retry behavior so short-lived server-side HTTP hiccups (529/502/503/504) are automatically retried even when --wait is not enabled, and adds a small fixed backoff before re-running timeout/transient-retry iterations in the task and internal review loops.
Changes:
- Reclassified
API Error: 529/502/503/504from Claude “limit” patterns to “retry” patterns so they follow timeout-style bounded retries without--wait. - Added a fixed
retryBackoff(5s) before continuing after a timed-out/transient-retry iteration in task and review loops. - Updated tests and docs to reflect the new defaults and the new backoff behavior.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates config docs to reflect retry-vs-limit pattern behavior and the new 5s backoff. |
| pkg/processor/phase/task.go | Adds retryBackoff sleep before retrying after a timeout/transient retry in the task loop. |
| pkg/processor/phase/task_test.go | Renames/updates timeout test to assert the new backoff sleep occurs. |
| pkg/processor/phase/review.go | Adds retryBackoff sleep before retrying after a timeout/transient retry in the internal review loop. |
| pkg/processor/phase/review_test.go | Updates timeout test to assert the new backoff sleep occurs (adds time import). |
| pkg/processor/phase/phase.go | Introduces shared retryBackoff = 5s constant for task/review loops. |
| pkg/config/values_test.go | Updates embedded-default assertions for Claude limit vs retry patterns. |
| pkg/config/defaults/config | Updates default ini values/comments to move 529/502/503/504 into claude_retry_patterns. |
| llms.txt | Syncs documentation of retry/limit behavior and defaults. |
| CLAUDE.md | Syncs documentation of retry precedence, moved patterns, and the new backoff. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
529 Overloaded and the 502/503/504 gateway errors lived in
claude_limit_patterns, which only auto-retries when--waitis set, and even then sleeps the full quota-window duration. Without--waita transient 529 hard-failed the run (originally hit during claude review 2).these are short-lived server hiccups, not account-quota limits. Moved them to
claude_retry_patterns: checked first, auto-retried through the existing timeout-style phase path, no--waitneeded, bounded by iteration limits.API Error: 500stays out since it can be a deterministic server failure, and is still caught by the broadAPI Error:error pattern. Precedence is retry -> limit -> error, so a no-signal 529 matches the retry tier first.also added a fixed 5s backoff (
retryBackoffinpkg/processor/phase/phase.go) before re-running a timed-out or transiently-failed iteration in the task loop and review-iteration loop. This covers all retry paths, including the pre-existing session/idle-timeout retries. The first-review soft-skip is not a retry, so it has no backoff.tests: updated default-pattern assertions in
pkg/config/values_test.go, renamedTestTaskPhase_Run_TimeoutContinuesWithoutSleeping->TestTaskPhase_Run_TimeoutBacksOffThenContinuesand asserted the backoff, added a backoff assertion to the review Loop-timeout test. Docs synced (README, llms.txt, CLAUDE.md).